package entities;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import api.entitites.Entities;
import api.entitites.IGarage;
import api.entitites.IOrder;

@Entity
@Table(name="garages")
public class Garage implements IGarage,Entities{
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="id_garage")
	private Integer id;
	
	@Column(name="number_garage")
	private Integer number;
	
	@Column(name="fullness_garage")
	private boolean fullness = false;
	
	@OneToOne(cascade=CascadeType.ALL,targetEntity=Order.class,mappedBy="garage")
	@JoinColumn(nullable = true)
	private IOrder order;

	public Integer getId() {
		return id;
	}

	public void setIdGarage(Integer idGarage) {
		this.id = idGarage;
	}

	public Integer getNumber() {
		return number;
	}

	public void setNumber(Integer number) {
		this.number = number;
	}

	public boolean getFullness() {
		return fullness;
	}

	public void setFullness(boolean fullness) {
		this.fullness = fullness;
	}
	
	public IOrder getOrder() {
		return order;
	}

	public void setOrder(IOrder order) {
		this.order = order;
	}

	

	
	
	
	
	

}
